#include <iostream>
using namespace std;

int main()
{
    cout << "学号：3170608043，姓名：石英钰" << endl;
    int year, month;
    cout << "Please input year: ";
    cin >> year;
    cout << "Please input month: ";
    cin >> month;
    if (month < 0 || month > 12)
    {
        cout << "Invalid month: " << month << ", month should not be negative or greater than 12." << endl;
        return 1;
    }

    int dayNum;
    switch (month)
    {
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
        dayNum = 31;
        break;
    case 4:
    case 6:
    case 9:
    case 11:
        dayNum = 30;
        break;
    case 2: // 重点
        bool case_1 = (year % 400 == 0),
             case_2 = (year % 4 == 0 && year % 100 != 0);
        // cout << case_1 << case_2 << endl;
        if (case_1 || case_2)
        { // 是闰年
            dayNum = 29;
        }
        else
        {
            dayNum = 28;
        }
        break;
    }
    printf("The number of days in month %d and year %d is %d\n", month, year, dayNum);
    return 0;
}